﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AutoMapper;
using DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst;
using DevWeb.Biztalk.DeploymentSettings.WebUI.Models;
using Microsoft.Practices.Unity;

namespace DevWeb.Biztalk.DeploymentSettings.WebUI.Controllers
{
    public class DeploymentLogController : BaseController
    {
        //
        // GET: /DeploymentLog/

        


        public ActionResult Index(int id)
        {
            IQueryable<DeploymentLog> deployments = null;

            deployments = Context.DeploymentLogs.Include("IntegrationVersion").Include("IntegrationVersion.Integration").Include("TargetEnvironment").Where(p => p.IntegrationVersion.Id.Equals(id));
                        
           
            var model = Mapper.Map<List<DeploymentLogViewModel>>(deployments);
            return View(model);
        }
    }
}